﻿<?php
include_once('common/header.php');	
if($AppUI->id <= 0 || !isset($_SERVER['HTTP_REFERER'])) {
	$this->_redirect(HOST_VFRIEND);
}
$strRefer	= isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
$intAlbumId	= Vfriend_Function::base64D($objRequest->getParam('albumid',''));
$strToken	= $objRequest->getParam('token','');
$strSession	= isset($_SESSION['albumDelete' . $intAlbumId]) ? $_SESSION['albumDelete' . $intAlbumId] : '';
$intError	= 0;
if($intError == 0 && Vfriend_Function::isValidLink($strRefer) && $strSession != '' && $strSession == $strToken) {
	$objPhoto	= new Photo();
	$intError	= $objPhoto->deleteAlbum($AppUI->id, $intAlbumId);
	if($intError == 0) {
		Vfriend_Function::setMsg($arrMessage[6]);
	} else {
		$intError = 14;
	}
} else {
	$intError = 11;
}
if($intError > 0) {
	Vfriend_Function::setError($arrError[$intError]);
}
$strRefer	= $strRefer ? $strRefer : Vfriend_Function::linkFullhouseForPhoto($AppUI->username,$AppUI->hex);
Vfriend_Function::redirect($strRefer);
exit();
?>